<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        // Commands\Inspire::class,
         Commands\OrderOverTime::class,
         Commands\ShopOverTime::class,
         Commands\OrderClear::class,
         Commands\ChargeOrderClear::class,
         Commands\BillClear::class,
         Commands\SmsLogClear::class,
         Commands\ComponentAccessToken::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')
        //          ->hourly();
        //订单超时处理
        $schedule->command('order:over')->everyThirtyMinutes();
        //无效订单处理
        $schedule->command('order:clear')->dailyAt('1:00');
        //无效水票处理
        $schedule->command('bill:clear')->dailyAt('2:00');
        //店铺到期处理
//        $schedule->command('shop:over')->daily();
        //无效续费订单处理
        $schedule->command('charge-order:clear')->dailyAt('3:00');
        //删除短信记录
        $schedule->command('smslog:clear')->dailyAt('4:00');
        //获取component_access_token
//        $schedule->command('wx:component_access_token')->everyMinute();
    }
}
